<?php

if ("only" == "for netbeans completion") {
    //@see http://blogs.oracle.com/netbeansphp/entry/recent_improvements_in_phpunit_support    
    require_once 'PHPUnit/Framework.php';
}

class PluginsTest extends PHPUnit_Framework_TestCase {
    private static function getBaseDirectory() {
        return dirname(dirname(dirname(__FILE__)));
    }
    
    public function testPhpExcel() {
        $internal_file = 'Plugins/PhpExcel/PHPExcel/IOFactory.php';
        $full_address = self::getBaseDirectory() . '/' . $internal_file;
        $this->assertTrue(file_exists($full_address), "PhpExcel plugin expected: $full_address");
    }
    
    public function testLabas() {
        $file = self::getBaseDirectory() . '/GUI/Tabs/Foresee/ForeseeDesign.php';
        require $file;
        $this->assertEquals(3, ForeseeDesign::get_array_value(array(2=>3), 2));
        $this->assertEquals(4, ForeseeDesign::get_array_value(array(2=>array(3=>4)), 2, 3));
        $this->assertEquals(5, ForeseeDesign::get_array_value(array(2=>array(3=>array(4=>5))), 2, 3, 4));
    }
}